package mdFile

import (
	"editor/dao"
	"github.com/gin-gonic/gin"
)

func GetMDFileInfo(c *gin.Context, id int64) (info *dao.MDFileInfo, err error) {
	return dao.GetMDFileInfo(c, id)
}

func UpdateMDFileContent(c *gin.Context, id int64, cons string) (err error) {
	return dao.UpdateMDFileContent(c, id, cons)
}

func CheckTitleIsRepeat(c *gin.Context, title string, categoryId, currentId int64) (isRepeat bool, err error) {
	return dao.CheckTitleIsRepeat(c, title, categoryId, currentId)
}

func CheckCategoryIsRepeat(c *gin.Context, dirname string, currentId int64) (isRepeat bool, err error) {
	return dao.CheckCategoryIsRepeat(c, dirname, currentId)
}

func UpdateMDSort(c *gin.Context, id int64, sortNum int64) (err error) {
	return dao.UpdateMDSort(c, id, sortNum)
}

func UpdateMDName(c *gin.Context, id int64, newName string) (err error) {
	return dao.UpdateMDName(c, id, newName)
}
